﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Microsoft.QualityTools.Testing.Fakes;

using TDDStudy.Library.WhatIsShim;
using TDDStudy.Library.WhatIsShim.Fakes;

namespace TDDStudy.WhatIsShim
{
    [TestClass]
    public class WhatIsStubTest
    {
        [TestMethod]
        public void Shim_Test()
        {
            using (ShimsContext.Create())
            {
                var domainService = new DomainService(CreateShimDependencyService());
                domainService.Task();
            }
        }

        private DependencyService CreateShimDependencyService()
        {
            return new ShimDependencyService
                    {
                        OtherTask = () => { }
                    };
        }
    }
}
